package com.china08.yxyapi.repository.mg.huodong;

import java.util.List;

import org.springframework.data.mongodb.repository.MongoRepository;

import com.china08.yxyapi.entity.mg.huodong.healthcompetition.YxyCompetitionStudentAnswer;

public interface YxyCompetitionStudentAnswerRepository extends MongoRepository<YxyCompetitionStudentAnswer, String> {
    /**
     * 得到该学生作答的题目集合
     * 
     * @param studentId
     * @return
     */
    List<YxyCompetitionStudentAnswer> findByStudentIdOrderByQuesOrder(String studentId);

    /**
     * 得到该学生最后作答的题目
     * 
     * @param studentId
     * @return
     */
    YxyCompetitionStudentAnswer findTop1ByStudentIdOrderByLastModifiedDateDesc(String studentId);

    /**
     * 根据学生id和试题order查询
     * 
     * @param studentId
     * @return
     */
    YxyCompetitionStudentAnswer findTop1ByStudentIdAndQuesOrder(String studentId, Integer order);
}
